/* shop.css - 商店页面特定样式 */

/* 商店页特有样式 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 分类项样式 */
.category-item-active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

/* 分类导航 */
.category-tabs {
  display: flex;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 0.75rem 1rem;
  white-space: nowrap;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.category-tab-active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.category-tab-inactive {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-dark);
}

/* 筛选器样式 */
.filter-drawer {
  position: fixed;
  inset: 0;
  background-color: rgba(27, 38, 59, 0.7);
  z-index: 50;
}

.filter-drawer__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  max-height: 80vh;
  overflow-y: auto;
}

.filter-drawer__header {
  position: sticky;
  top: 0;
  background-color: rgba(45, 106, 79, 0.95);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.filter-drawer__body {
  padding: 1rem;
}

/* 购物车模态框 */
.cart-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(27, 38, 59, 0.7);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cart-modal__content {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  width: 100%;
  max-width: 48rem;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  box-shadow: var(--shadow-2xl);
  transform: translateY(0);
  transition: transform 0.3s ease-out;
  max-height: 85vh;
  height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .cart-modal__content {
    max-height: 90vh;
    height: 90vh;
  }
}

.cart-modal__header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: rgba(45, 106, 79, 0.95);
  color: white;
  z-index: 10;
}

.cart-modal__title {
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
}

.cart-modal__close {
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.cart-modal__close:hover {
  color: white;
}

.cart-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.cart-modal__footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: rgba(149, 213, 178, 0.2);
  position: sticky;
  bottom: 0;
}

/* 购物车项目样式 */
.cart-item {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.cart-item__image {
  width: 5rem;
  height: 5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item__content {
  margin-left: 0.75rem;
  flex: 1;
}

.cart-item__title {
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item__price {
  color: var(--color-primary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.cart-item__quantity {
  display: flex;
  align-items: center;
  border: 1px solid rgba(149, 213, 178, 0.3);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  background-color: white;
  margin-top: 0.75rem;
}

.cart-item__quantity-btn {
  padding: 0.5rem;
  color: var(--color-dark);
}

.cart-item__quantity-value {
  padding: 0 0.5rem;
  font-weight: 500;
  min-width: 2rem;
  text-align: center;
}

.cart-item__remove {
  color: var(--color-danger);
  background-color: rgba(230, 57, 70, 0.1);
  padding: 0.5rem;
  border-radius: 9999px;
}

/* 隐藏滚动条但保持功能 */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
